# coding: utf-8
from . import db, BaseModel


class ChatMessage(db.Model):
    __tablename__ = 'chat_message'

    auto_id = db.Column(db.BigInteger, primary_key=True, info='自增id')
    message_id = db.Column(db.BigInteger, info='消息id')
    con_id = db.Column(db.BigInteger, info='咨询者id')
    psy_id = db.Column(db.BigInteger, info='咨询师id')
    content = db.Column(db.String(255, 'utf8mb4_0900_ai_ci'), server_default=db.FetchedValue(), info='内容')
    last_messge_id = db.Column(db.BigInteger, info='上条信息id')
    is_delete = db.Column(db.Integer, server_default=db.FetchedValue(), info='是否已删除')
    create_time = db.Column(db.DateTime, server_default=db.FetchedValue(), info='创建时间')
    update_time = db.Column(db.DateTime, server_default=db.FetchedValue(), info='更新时间')
